{% load i18n %}

<div class="layout__list">
  {% for n in notifications %}
    <div class="layout__list__item">
      {% url "spirit:user:detail" pk=n.comment.user.pk slug=n.comment.user.st.slug as url_profile %}
      {% url "spirit:comment:find" pk=n.comment.pk as url_topic %}

      <div class="layout__list__item__title">
        {% if n.is_comment %}
          {% blocktrans trimmed with username=n.comment.user.st.nickname topic_title=n.topic.title %}
            <a href="{{ url_profile }}">{{ username }}</a> has commented on <a href="{{ url_topic }}">{{ topic_title }}</a>
          {% endblocktrans %}
        {% elif n.is_mention %}
          {% blocktrans trimmed with username=n.comment.user.st.nickname topic_title=n.topic.title %}
            <a href="{{ url_profile }}">{{ username }}</a> has mention you on <a href="{{ url_topic }}">{{ topic_title }}</a>
          {% endblocktrans %}
        {% else %}
          Unknow action
        {% endif %}
        {% if not n.is_read %}
          <span class="unread">{% trans "unread" %}</span>
        {% endif %}
      </div>
    </div>
  {% empty %}
    <p>{% trans "There are no notifications, yet" %}</p>
  {% endfor %}
</div>
